import {get,post,put,setTokens} from "../httpx";
import {AskApi} from "../urls";

const getAllAsk = ()=>get(AskApi.getAll)

const getAskById = id=>get(AskApi.getById+"?id="+id )

const getRepliesByAsk = id=>get(AskApi.getAllReplies+"?id="+id)

const addAsk = data => post(AskApi.addAsk,data)

const addReply = data=>post(AskApi.addReply,data)

const removeAsk = id=>post(AskApi.removeAsk+"?id="+id)

const removeReply = id=>post(AskApi.removeReply+"?id="+id)

const editAsk = data => post(AskApi.editAsk,data)

export const Ask = {
    getAllAsk,getRepliesByAsk,getAskById,addAsk,addReply,removeAsk,removeReply,editAsk
}
